package client

import (
	"yunj/app/enum/adenum"
	service "yunj/app/service/client"

	"github.com/gin-gonic/gin"
)

type Index struct {
	Controller
}

// 首页
func (ctrl *Index) Index(c *gin.Context) {
	data := map[string]interface{}{
		"carousel":         service.Ad.ItemsByNormalPublish(adenum.LOCATION_INDEX_CAROUSEL),
		"topCategoryItems": service.Category.GetItemsByTopNormal(),
		"articlePageData":  service.Article.PageList(),
	}
	ctrl.Render(c, "index/index", data)
}
